package 字符串;

import javax.xml.crypto.dsig.spec.XSLTTransformParameterSpec;

public class char类型转换int {
    public static void main(String[] args) {
        String str = "1234";
        int sum = 0;
        char b= 'b';
        for (int i = 0; i < str.length(); i++) {
            sum = sum + str.charAt(i)-'0';

        }
        System.out.println(sum);

    }
}
